define(["jquery"],function($){
	var servers = {};

	// 原始数据
	var staticData = function(){
		return [
			{
				"key":"001",
				"monthAge":"1月龄",
				"vaccine":["乙肝②","进口10乙肝"]
			},
			{
				"key":"002",
				"monthAge":"2月龄",
				"vaccine":["脊灰①","IPV/五联①"]
			},
			{
				"key":"003",
				"monthAge":"3月龄",
				"vaccine":["脊灰②","百白破①","IPV/五联②"]
			},
			{
				"key":"004",
				"monthAge":"3.5月龄",
				"vaccine":["7价肺炎①","HIB①"]
			},
			{
				"key":"005",
				"monthAge":"4月龄",
				"vaccine":["脊灰③","百白破②"]
			},
			{
				"key":"006",
				"monthAge":"4.5月龄",
				"vaccine":["7价肺炎②","HIB②"]
			},
			{
				"key":"007",
				"monthAge":"5月龄",
				"vaccine":["百白破③"]
			},
			{
				"key":"008",
				"monthAge":"5.5月龄",
				"vaccine":["7价肺炎③","HIB③"]
			},
			{
				"key":"009",
				"monthAge":"季节性",
				"vaccine":["儿童流感"]
			},
			{
				"key":"010",
				"monthAge":"6月龄",
				"vaccine":["乙肝③","流脑A①","儿童流感①","进口10乙肝"]
			},
			{
				"key":"011",
				"monthAge":"7月龄",
				"vaccine":["儿童流感②","Hbv-Ac结合"]
			},
			{
				"key":"012",
				"monthAge":"8月龄",
				"vaccine":["麻风","乙脑①"]
			},
			{
				"key":"013",
				"monthAge":"9月龄",
				"vaccine":["乙脑灭活"]
			},
			{
				"key":"014",
				"monthAge":"10月龄",
				"vaccine":["流脑A②","Hbv-Ac结合"]
			},
			{
				"key":"015",
				"monthAge":"11月龄",
				"vaccine":["口服轮状苗①"]
			},
			{
				"key":"016",
				"monthAge":"12月龄",
				"vaccine":["水痘"]
			},
			{
				"key":"017",
				"monthAge":"13月龄",
				"vaccine":["7价肺炎④"]
			},
			{
				"key":"018",
				"monthAge":"14月龄",
				"vaccine":["兰菌净①"]
			},
			{
				"key":"019",
				"monthAge":"15月龄",
				"vaccine":["兰菌净②"]
			},
			{
				"key":"020",
				"monthAge":"18-24月龄",
				"vaccine":["麻腮风","甲肝疫苗","百白破（加强）","甲肝灭活疫苗","五联④","HIB④"]
			},
			{
				"key":"021",
				"monthAge":"2周岁后",
				"vaccine":["乙脑②","乙脑灭活","23价肺炎","霍乱"]
			},
			{
				"key":"021",
				"monthAge":"3周岁后",
				"vaccine":["A+C群多糖流脑①","甲乙肝疫苗","成人流感"]
			},
			{
				"key":"021",
				"monthAge":"4周岁后",
				"vaccine":["脊灰（加强）","IPV"]
			},
			{
				"key":"021",
				"monthAge":"6周岁后",
				"vaccine":["白破（加强）","A+C群多糖流脑②"]
			}
		]
	}

	// 接种月龄总和
	var monthAge = function(){
		var list = staticData();
		var arr = [];
		for (var i = 0; i < list.length; i++) {
			arr.push(list[i].monthAge);
		}
		return arr;
	}
	// 疫苗类型
	servers.vaccineType = function(monthAge){
		var list = staticData();
		for (var i = 0; i < list.length; i++) {
			if( list[i].monthAge == monthAge ){
				return list[i].vaccine;
			}
		}
	}
	/**
	 * 获取问题
	 */
	servers.getQuestiones = function(monthage){
		var vaccineType = monthage ? this.vaccineType(monthage) : this.vaccineType("1月龄");
		return [
			[
				{
				    "showLabel": false,
				    "type": "qusetion_group",
				    "children": [
				    	{
				            "id": "vaccineInoculationAdd001",
				            "label": "接种月龄",
				            "length": 12,
				            "type": "question_select",
				            "list": monthAge(),
				        },
				        {
				            "id": "vaccineInoculationAdd002",
				            "label": "疫苗类型",
				            "length": 6,
				            "type": "question_select",
				            "list": vaccineType,
				        },
				        {
				            "id": "vaccineInoculationAdd003",
				            "label": "接种位置",
				            "length": 6,
				            "type": "question_select",
				            "list": [
				            	"左上",
				            	"右上",
				            ],
				        },
				        {
				            "id": "vaccineInoculationAdd004",
				            "label": "疫苗厂商",
				            "length":6,
				            "type": "question_text"
				        },
				        {
				            "id": "vaccineInoculationAdd005",
				            "label": "疫苗编号",
				            "length":6,
				            "type": "question_text"
				        },
				        {
				            "id": "vaccineInoculationAdd006",
				            "label": "不良反应",
				            "length":8,
				            "type": "question_radioWithInput",
						    "list": [
						        "无",
						        "有",
						    ],
						    "relationKey":"有",
						    "val":["无",""],
				        },
				        {
				            "id": "vaccineInoculationAdd007",
				            "label": "接种时间",
				            "length":6,
				            "val":"today",
				            "type": "question_date"
				        },
				        {
				            "id": "vaccineInoculationAdd008",
				            "label": "接种人",
				            "length":6,
				            "val":"doctorName",
				            "type": "question_text",
				        }
					],
				}
			]
		];
	}

	return servers;
});